package com.boardgame.common.entity;


import lombok.Data;

/**
 * Created by pdybka on 15.06.16.
 */

@Data
public class ResponseInfo<T> {
    private T result;
    private int status;

    public ResponseInfo(T result, int status) {
        this.result = result;
        this.status = status;
    }

    /**
     * 返回成功
     * @param result
     * @param <Result>
     * @return
     */
    public static <Result> ResponseInfo Success(Result result) {
        ResponseInfo responseInfo = new ResponseInfo(result,200);
        return responseInfo;
    }

    /**
     * 失败
     * @param <Result>
     * @return
     */
    public static <Result> ResponseInfo Failed(String msg) {
        ResponseInfo responseInfo = new ResponseInfo(msg,0);
        return responseInfo;
    }

//    public enum Status {
//        CREATED,
//        NOT_CREATED,
//        RECEIVED,
//        NOT_RECEIVED
//    }

}
